﻿@model RM.QuickLogOn.OAuth.Models.TwitterSettingsPart
@using Orchard.Utility.Extensions;
@{
    var baseUri = new Uri(WorkContext.CurrentSite.BaseUrl);
    var callbackUrl = new Uri(baseUri, Url.Action("Auth", "TwitterOAuth", new { area = "RM.QuickLogOn.OAuth" })).ToString();
 }
<fieldset>
    <legend>@T("Twitter OAuth")</legend>
    <ol style="list-style-type: decimal;padding-left: 20px;">
        <li>@T("Setup or update existing Twitter application:")&nbsp;<a href="https://dev.twitter.com/apps">https://dev.twitter.com/apps/Applications</a></li>
        <li>@T("Put callback url to Twitter application settings:")&nbsp;@Html.Link(callbackUrl, callbackUrl)</li>
        <li>@T("Receive ConsumerKey, AccessToken and ConsumerSecret from Twitter application and put them into appropriate fields below")</li>
    </ol>
    <div>
        <label for="@Html.FieldIdFor(m => m.ConsumerKey)">@T("Consumer Key")</label>
        @Html.TextBoxFor(m=>m.ConsumerKey)
        @Html.ValidationMessage("ConsumerKey", "*")
        <span class="hint">@T("Enter consumer key.")</span>
    </div>
    <div>
        <label for="@Html.FieldIdFor(m => m.AccessToken)">@T("Access Token")</label>
        @Html.TextBoxFor(m=>m.AccessToken)
        @Html.ValidationMessage("Enter access token", "*")
    </div>
    <div>
        <label for="@Html.FieldIdFor(m => m.ConsumerSecret)">@T("Consumer Secret")</label>
        @Html.PasswordFor(m=>m.ConsumerSecret)
        @Html.ValidationMessage("ConsumerSecret", "*")
        <span class="hint">@T("Entre consumer secret to change. If empty then no change.")</span>
    </div>
</fieldset>